package cn.imnaer.service.rpc.schedule.process;

import cn.imnaer.database.BaseDao;
import cn.imnaer.database.MatchConst;
import cn.imnaer.database.define.DBConstant;
import cn.imnaer.service.persistence.model.Schedule;
import cn.imnaer.service.persistence.model.consts.SCHEDULE;

import org.bson.BSONObject;
import org.bson.BasicBSONObject;
import org.bson.types.BasicBSONList;

import java.util.List;

public class ScheduleDbHelper extends BaseDao<Schedule> {
    public ScheduleDbHelper() {
//        this.dbSpaceName = DBConstant.USER_INFO_SPACE;
//        this.dbCollectionName = DBConstant.MY_SCHEDULE_LIST_DATA;
    }

    public void deleteObejcts(
            List<String> list) {
        System.out.println(list.size());
        BSONObject query = new BasicBSONObject();
        BSONObject arr = new BasicBSONList();
        int i = 0;
        for (String id : list) {
            BSONObject mather = new BasicBSONObject();
            mather.put(SCHEDULE.scheduleId, id);
            arr.put(String.valueOf(i), mather);
            i++;


        }
        query.put(MatchConst._OR, arr);
        System.out.println(query);
        this.delete(query);
    }

	@Override
	protected String getDbSpaceName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected String getDbCollectionName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected String getPrimaryKey() {
		// TODO Auto-generated method stub
		return null;
	}
}
